#ifndef CSHADER_HXX_
#define CSHADER_HXX_
#include<string>
#include <GL/glut.h>
using namespace std;
class CShader {
public:
	CShader(const string &vertFile,const string &fragFile);
	virtual ~CShader();
	void setUniformf(const string &uniformName,int singleSize,int ArraSize,const float *value);
	void setVertexAttribf(const string &attribName,int singleSize,const float* value);
	void setUniformi(const string &uniformName,int singleSize,int arraSize,const int *value);
	void setUniformMaxtrixf(const string &uniformName,int m,int count ,bool tanspose,const float *values);
	void setTexture(const string &texName,int texID,int bindTexIdx,GLuint textureType = GL_TEXTURE_2D);
	void beginShader();
	void endShader();
private:
	string textFileRead(const string& fn);
	void printProgramInfo(GLuint obj);
	void printShaderInfo(GLuint obj);
	void linkShader();
	string vertSource,fragSource;
	GLuint vertID,fragID,shaderID;
};

#endif /* CSHADER_HXX_ */